{extend name="../../base/view/common/base" /}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
    <h3 class="pb-3">添加信息</h3>
    {if condition="($id == 0)"}
    <table class="layui-table layui-table-form">
        <tr>
            <td colspan="6"><strong>证书专业</strong></td>
        </tr>
        <tr>
            <td class="layui-td-gray">证书专业</td>
            <td>
                <select name="cert_major_type" lay-reqText="请选择专业">
                    <option value="">请选择专业类型</option>
                    <option value="1">房建</option>
                    <option value="2">市政</option>
                    <option value="3">机电</option>
                    <option value="4">水利</option>
                    <option value="5">公路</option>
                    <option value="6">矿业</option>
                    <option value="7">通信</option>
                    <option value="8">岩土</option>
                    <option value="9">港口与航道工程</option>
                    <option value="10">暖通空调</option>
                    <option value="11">给水排水</option>
                    <option value="12">动力</option>
                    <option value="13">发输变电</option>
                    <option value="14">供配电</option>
                    <option value="15">建筑</option>
                    <option value="16">造价（土建）</option>
                    <option value="17">造价（安装）</option>
                    <option value="18">水利水电工程</option>
                    <option value="19">注册化工</option>
                    <option value="20">注册环保</option>
                    <option value="21">注册结构</option>
                    <option value="22">道路工程</option>
                </select>
            </td>
        </tr>
        <tr>
            <td colspan="6"><strong>人员信息</strong></td>
        </tr>
        <tr>
            <td class="layui-td-gray">人员类型</td>
            <td>
                <select name="p_type" lay-reqText="请选择人员类型">
                    <option value="">请选择人员类型</option>
                    <option value="1">一级注册建筑师</option>
                    <option value="2">二级注册建筑师</option>
                    <option value="3">一级注册结构工程师</option>
                    <option value="4">二级注册结构工程师</option>
                    <option value="5">注册土木工程师(岩土)</option>
                    <option value="6">注册土木工程师(港口与航道工程)</option>
                    <option value="7">注册公用设备工程师(暖通空调)</option>
                    <option value="8">注册公用设备工程师(给水排水)</option>
                    <option value="9">注册公用设备工程师(动力)</option>
                    <option value="10">注册电气工程师(发输变电)</option>
                    <option value="11">注册电气工程师(供配电)</option>
                    <option value="12">注册化工工程师</option>
                    <option value="13">监理工程师</option>
                    <option value="14">一级注册建造师</option>
                    <option value="15">二级注册建造师</option>
                    <option value="16">造价工程师</option>
                    <option value="17">二级造价师</option>
                    <option value="18">三类人员A类</option>
                    <option value="19">三类人员B类</option>
                    <option value="20">三类人员C类</option>
                    <option value="21">施工员</option>
                    <option value="22">质量员</option>
                    <option value="23">安全员</option>
                    <option value="24">标准员</option>
                    <option value="25">材料员</option>
                    <option value="26">机械员</option>
                    <option value="27">劳务员</option>
                    <option value="28">资料员</option>
                    <option value="29">注册土木工程师（水利水电）</option>
                    <option value="30">注册土木工程师（道路工程）</option>
                    <option value="31">注册环保工程师</option>
                </select>
            </td>
        </tr>
        <tr>
            <td class="layui-td-gray-2">姓名</td>
            <td>
                <input type="text" name="salesman_name" autocomplete="off" placeholder="姓名"
                       class="layui-input">
            </td>
            <td class="layui-td-gray-2">身份证号码<font>*</font></td>
            <td>
                <input type="text" name="id_card" lay-verify="required" autocomplete="off"
                       placeholder="身份证号码"
                       class="layui-input">
            </td>

        </tr>
        <tr>
            <td class="layui-td-gray-2">手机号</td>
            <td>
                <input type="text" name="salesman_mobile" autocomplete="off" placeholder="手机号"
                       class="layui-input">
            </td>
        </tr>
        <tr>
            <td class="layui-td-gray-2">账号</td>
            <td>
                <input type="text" name="user_name" autocomplete="off" placeholder="账号"
                       class="layui-input">
            </td>
            <td class="layui-td-gray-2">密码</td>
            <td>
                <input type="text" name="user_pass" autocomplete="off" placeholder="密码"
                       class="layui-input">
            </td>
        </tr>

        <tr>
            <td colspan="6"><strong>请将附件名称描述清楚（多附件格式）</strong></td>
        </tr>
        <tr>
            <td class="layui-td-gray">
                <button type="button" class="layui-btn layui-btn-sm" id="uploadBtn"><i class="layui-icon"></i>人员附件上传
                </button>
            </td>
            <td colspan="5" style="line-height:inherit">
                <div class="layui-row" id="fileBox">
                    <input type="hidden" id="fileBoxInput" data-type="file" name="file_ids" value="">
                </div>
            </td>
        </tr>
        <tr>
            <td colspan="6"><strong>社保信息</strong></td>
        </tr>
        <tr>
            <td class="layui-td-gray-2">社保地</td>
            <td>
                <input type="text" name="security_address" autocomplete="off" placeholder="社保地"
                       class="layui-input">
            </td>

            <td class="layui-td-gray">社保情况</td>
            <td>
                <select name="security_type" lay-reqText="请选择社保情况">
                    <option value="">请选择社保情况</option>
                    <option value="1">有社保</option>
                    <option value="2">无社保</option>
                </select>
            </td>
        </tr>
        <tr>
            <td colspan="6"><strong>其他信息</strong></td>
        </tr>
        <tr>
            <td class="layui-td-gray">ABC信息</td>
            <td>
                <!--<select name="abc_type" lay-reqText="请选择ABC信息">-->
                <!--<option value="">请选择ABC信息</option>-->
                <!--<option value="1">无</option>-->
                <!--<option value="2">A证信息</option>-->
                <!--<option value="3">B证信息</option>-->
                <!--<option value="4">C证信息</option>-->
                <!--</select>-->
                <input type="checkbox" name="abc_type[]" title="无" value="1" lay-skin="primary">
                <input type="checkbox" name="abc_type[]" title="A证信息" value="2" lay-skin="primary">
                <input type="checkbox" name="abc_type[]" title="B证信息" value="3" lay-skin="primary">
                <input type="checkbox" name="abc_type[]" title="C证信息" value="4" lay-skin="primary">
            </td>
        </tr>
        <tr>
            <td class="layui-td-gray-2">意向年限</td>
            <td>
                <input type="text" name="year" autocomplete="off" placeholder="意向年限"
                       class="layui-input">
            </td>

            <td class="layui-td-gray-2">证书有效期</td>
            <td>
                <input type="text" id="cert_valid_date" name="cert_valid_date" autocomplete="off"
                       lay-reqText="证书有效期" placeholder="证书有效期" class="layui-input">
            </td>
        </tr>
        <tr id="flow_tr">
            <td class="layui-td-gray">收证人<font>*</font></td>
            <td>
                <input type="text" name="put_user_name" autocomplete="off" placeholder="请选择出证人" lay-verify="required"
                       lay-reqText="出证人" class="layui-input picker-one" readonly><input type="hidden"
                                                                                        name="put_user_id" readonly>
            </td>
        </tr>
        <tr>
            <td class="layui-td-gray-2">收证金额</td>
            <td>
                <input type="text" name="money" autocomplete="off" placeholder="收证金额"
                       class="layui-input">
            </td>
            <td class="layui-td-gray-2">ABC有效期</td>
            <td>
                <input type="text" id="abc_valid_date" name="abc_valid_date" autocomplete="off"
                       lay-reqText="ABC有效期" placeholder="ABC有效期" class="layui-input">
            </td>
        </tr>

        <!--<tr>-->
            <!--<td colspan="6"><strong>注册信息</strong></td>-->
        <!--</tr>-->
        <!--<tr>-->
            <!--<td class="layui-td-gray-2">注册单位</td>-->
            <!--<td>-->
                <!--<input type="text" id="reg_unit" name="reg_unit" autocomplete="off"-->
                       <!--lay-reqText="注册单位" placeholder="注册单位" class="layui-input">-->
            <!--</td>-->
        <!--</tr>-->
        <!--<tr>-->
            <!--<td class="layui-td-gray-2">注册时间</td>-->
            <!--<td>-->
                <!--<input type="text" id="reg_date" name="reg_date" autocomplete="off"-->
                       <!--lay-reqText="注册时间" placeholder="注册时间" class="layui-input">-->
            <!--</td>-->
        <!--</tr>-->
        <tr>
            <td colspan="6">
                <textarea name="remark" placeholder="请输入备注信息" class="layui-textarea"></textarea>
            </td>
        </tr>
    </table>
    {else/}
    <table class="layui-table layui-table-form">
        <tr>
            <td colspan="6"><strong>证书专业</strong></td>
        </tr>
        <tr>
            <td class="layui-td-gray">证书专业</td>
            <td>
                <select name="cert_major_type" lay-reqText="请选择专业">
                    <option value="">请选择专业类型</option>
                    <option value="1"
                    <?php if($detail['cert_major_type'] == 1) echo 'selected' ?>  >房建</option>
                    <option value="2"
                    <?php if($detail['cert_major_type'] == 2) echo 'selected' ?>>市政</option>
                    <option value="3"
                    <?php if($detail['cert_major_type'] == 3) echo 'selected' ?>>机电</option>
                    <option value="4"
                    <?php if($detail['cert_major_type'] == 4) echo 'selected' ?>>水利</option>
                    <option value="5"
                    <?php if($detail['cert_major_type'] == 5) echo 'selected' ?>>公路</option>
                    <option value="6"
                    <?php if($detail['cert_major_type'] == 6) echo 'selected' ?>>矿业</option>
                    <option value="7"
                    <?php if($detail['cert_major_type'] == 7) echo 'selected' ?>>通信</option>
                    <option value="8"
                    <?php if($detail['cert_major_type'] == 8) echo 'selected' ?>>岩土</option>
                    <option value="9"
                    <?php if($detail['cert_major_type'] == 9) echo 'selected' ?>>港口与航道工程</option>
                    <option value="10"
                    <?php if($detail['cert_major_type'] == 10) echo 'selected' ?>>暖通空调</option>
                    <option value="11"
                    <?php if($detail['cert_major_type'] == 11) echo 'selected' ?>>给水排水</option>
                    <option value="12"
                    <?php if($detail['cert_major_type'] == 12) echo 'selected' ?>>动力</option>
                    <option value="13"
                    <?php if($detail['cert_major_type'] == 13) echo 'selected' ?>>发输变电</option>
                    <option value="14"
                    <?php if($detail['cert_major_type'] == 14) echo 'selected' ?>>供配电</option>
                    <option value="15" <?php if($detail['cert_major_type'] == 15) echo 'selected' ?>>建筑</option>
                    <option value="16" <?php if($detail['cert_major_type'] == 16) echo 'selected' ?>>造价（土建）</option>
                    <option value="17" <?php if($detail['cert_major_type'] == 17) echo 'selected' ?>>造价（安装）</option>
                    <option value="18" <?php if($detail['cert_major_type'] == 18) echo 'selected' ?>>水利水电工程</option>
                    <option value="19" <?php if($detail['cert_major_type'] == 19) echo 'selected' ?>>注册化工</option>
                    <option value="20" <?php if($detail['cert_major_type'] == 20) echo 'selected' ?>>注册环保</option>
                    <option value="21" <?php if($detail['cert_major_type'] == 21) echo 'selected' ?>>注册结构</option>
                    <option value="22" <?php if($detail['cert_major_type'] == 22) echo 'selected' ?>>道路工程</option>
                </select>
            </td>
        </tr>
        <tr>
            <td colspan="6"><strong>人员信息</strong></td>
        </tr>
        <tr>
            <td class="layui-td-gray">人员类型</td>
            <td>
                <select name="p_type" lay-reqText="请选择人员类型">
                    <option value="">请选择人员类型</option>
                    <option value="1"
                    <?php if($detail['p_type'] == 1) echo 'selected' ?>>一级注册建筑师</option>
                    <option value="2"
                    <?php if($detail['p_type'] == 2) echo 'selected' ?>>二级注册建筑师</option>
                    <option value="3"
                    <?php if($detail['p_type'] == 3) echo 'selected' ?>>一级注册结构工程师</option>
                    <option value="4"
                    <?php if($detail['p_type'] == 4) echo 'selected' ?>>二级注册结构工程师</option>
                    <option value="5"
                    <?php if($detail['p_type'] == 5) echo 'selected' ?>>注册土木工程师(岩土)</option>
                    <option value="6"
                    <?php if($detail['p_type'] == 6) echo 'selected' ?>>注册土木工程师(港口与航道工程)</option>
                    <option value="7"
                    <?php if($detail['p_type'] == 7) echo 'selected' ?>>注册公用设备工程师(暖通空调)</option>
                    <option value="8"
                    <?php if($detail['p_type'] == 8) echo 'selected' ?>>注册公用设备工程师(给水排水)</option>
                    <option value="9"
                    <?php if($detail['p_type'] == 9) echo 'selected' ?>>注册公用设备工程师(动力)</option>
                    <option value="10"
                    <?php if($detail['p_type'] == 10) echo 'selected' ?>>注册电气工程师(发输变电)</option>
                    <option value="11"
                    <?php if($detail['p_type'] == 11) echo 'selected' ?>>注册电气工程师(供配电)</option>
                    <option value="12"
                    <?php if($detail['p_type'] == 12) echo 'selected' ?>>注册化工工程师</option>
                    <option value="13"
                    <?php if($detail['p_type'] == 13) echo 'selected' ?>>监理工程师</option>
                    <option value="14"
                    <?php if($detail['p_type'] == 14) echo 'selected' ?>>一级注册建造师</option>
                    <option value="15"
                    <?php if($detail['p_type'] == 15) echo 'selected' ?>>二级注册建造师</option>
                    <option value="16"
                    <?php if($detail['p_type'] == 16) echo 'selected' ?>>造价工程师</option>
                    <option value="17"
                    <?php if($detail['p_type'] == 17) echo 'selected' ?>>二级造价师</option>
                    <option value="18"
                    <?php if($detail['p_type'] == 18) echo 'selected' ?>>三类人员A类</option>
                    <option value="19"
                    <?php if($detail['p_type'] == 19) echo 'selected' ?>>三类人员B类</option>
                    <option value="20"
                    <?php if($detail['p_type'] == 20) echo 'selected' ?>>三类人员C类</option>
                    <option value="21"
                    <?php if($detail['p_type'] == 21) echo 'selected' ?>>施工员</option>
                    <option value="22"
                    <?php if($detail['p_type'] == 22) echo 'selected' ?>>质量员</option>
                    <option value="23"
                    <?php if($detail['p_type'] == 23) echo 'selected' ?>>安全员</option>
                    <option value="24"
                    <?php if($detail['p_type'] == 24) echo 'selected' ?>>标准员</option>
                    <option value="25"
                    <?php if($detail['p_type'] == 25) echo 'selected' ?>>材料员</option>
                    <option value="26"
                    <?php if($detail['p_type'] == 26) echo 'selected' ?>>机械员</option>
                    <option value="27"
                    <?php if($detail['p_type'] == 27) echo 'selected' ?>>劳务员</option>
                    <option value="28"
                    <?php if($detail['p_type'] == 28) echo 'selected' ?>>资料员</option>
                    <option value="29" <?php if($detail['p_type'] == 29) echo 'selected' ?>>注册土木工程师（水利水电）</option>
                    <option value="30" <?php if($detail['p_type'] == 30) echo 'selected' ?>>注册土木工程师（道路工程）</option>
                    <option value="31" <?php if($detail['p_type'] == 31) echo 'selected' ?>>注册环保工程师</option>
                </select>
            </td>
        </tr>
        <tr>
            <td class="layui-td-gray-2">姓名</td>
            <td>
                <input type="text" name="salesman_name" value="{$detail.salesman_name}" autocomplete="off"
                       placeholder="姓名"
                       class="layui-input">
            </td>
            <td class="layui-td-gray-2">身份证号码<font>*</font></td>
            <td>
                <input type="text" name="id_card" lay-verify="required" value="{$detail.id_card}" autocomplete="off"
                       placeholder="身份证号码"
                       class="layui-input">
            </td>

        </tr>
        <tr>
            <td class="layui-td-gray-2">手机号</td>
            <td>
                <input type="text" name="salesman_mobile" value="{$detail.salesman_mobile}" autocomplete="off" placeholder="手机号"
                       class="layui-input">
            </td>
        </tr>
        <tr>
            <td class="layui-td-gray-2">账号</td>
            <td>
                <input type="text" name="user_name" value="{$detail.user_name}" autocomplete="off" placeholder="账号"
                       class="layui-input">
            </td>
            <td class="layui-td-gray-2">密码</td>
            <td>
                <input type="text" name="user_pass" value="{$detail.user_pass}" autocomplete="off" placeholder="密码"
                       class="layui-input">
            </td>
        </tr>

        <tr>
            <td colspan="6"><strong>请将附件名称描述清楚（多附件格式）</strong></td>
        </tr>
        <tr>
            <td class="layui-td-gray">
                <button type="button" class="layui-btn layui-btn-sm" id="uploadBtn"><i class="layui-icon"></i>人员附件上传
                </button>
            </td>
            <td colspan="5" style="line-height:inherit">
                <div class="layui-row" id="fileBox">
                    <input type="hidden" data-type="file" name="file_ids" value="{$detail.file_ids}">
                    {notempty name="$detail.file_ids"}
                    {volist name="$detail.fileArray" id="vo"}
                    <div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo)}</div>
                    {/volist}
                    {/notempty}
                </div>
            </td>
        </tr>

        <tr>
            <td colspan="6"><strong>社保信息</strong></td>
        </tr>
        <tr>
            <td class="layui-td-gray-2">社保地</td>
            <td>
                <input type="text" name="security_address" value="{$detail.security_address}" autocomplete="off"
                       placeholder="社保地"
                       class="layui-input">
            </td>

            <td class="layui-td-gray">社保情况</td>
            <td>
                <select name="security_type" lay-reqText="请选择社保情况">
                    <option value="">请选择社保情况</option>
                    <option value="1"
                    <?php if($detail['security_type'] == 1) echo 'selected' ?>>有社保</option>
                    <option value="2"
                    <?php if($detail['security_type'] == 2) echo 'selected' ?>>无社保</option>
                </select>
            </td>
        </tr>
        <tr>
            <td colspan="6"><strong>其他信息</strong></td>
        </tr>
        <tr>
            <td class="layui-td-gray">ABC信息</td>
            <td>
                <input type="checkbox" name="abc_type[]" title="无" value="1" <?php if(in_array('1',$detail['abc_type'])){ echo 'checked';}?> lay-skin="primary">
                <input type="checkbox" name="abc_type[]" title="A证信息" value="2" <?php if(in_array('2',$detail['abc_type'])){ echo 'checked';}?> lay-skin="primary">
                <input type="checkbox" name="abc_type[]" title="B证信息" value="3" <?php if(in_array('3',$detail['abc_type'])){ echo 'checked';}?> lay-skin="primary">
                <input type="checkbox" name="abc_type[]" title="C证信息" value="4" <?php if(in_array('4',$detail['abc_type'])){ echo 'checked';}?> lay-skin="primary">
            </td>
        </tr>
        <tr>
            <td class="layui-td-gray-2">意向年限</td>
            <td>
                <input type="text" name="year" value="{$detail.year}" autocomplete="off" placeholder="意向年限"
                       class="layui-input">
            </td>

            <td class="layui-td-gray-2">证书有效期</td>
            <td>
                <input type="text" id="cert_valid_date" value="{$detail.cert_valid_date}" name="cert_valid_date"
                       autocomplete="off"
                       lay-reqText="证书有效期" placeholder="证书有效期" class="layui-input">
            </td>
        </tr>
        <tr id="flow_tr">
            <td class="layui-td-gray">收证人<font>*</font></td>
            <td>
                <input type="text" name="put_user_name" value="{$detail.put_user_name}" autocomplete="off" placeholder="请选择出证人" lay-verify="required"
                       lay-reqText="出证人" class="layui-input picker-one" readonly><input type="hidden"
                                                                                        name="put_user_id"  value="{$detail.put_user_id}" readonly>
            </td>
        </tr>
        <tr>
            <td class="layui-td-gray-2">收证金额</td>
            <td>
                <input type="text" name="money" value="{$detail.money}" autocomplete="off" placeholder="收证金额"
                       class="layui-input">
            </td>
            <td class="layui-td-gray-2">ABC有效期</td>
            <td>
                <input type="text" id="abc_valid_date" value="{$detail.abc_valid_date}" name="abc_valid_date"
                       autocomplete="off"
                       lay-reqText="ABC有效期" placeholder="ABC有效期" class="layui-input">
            </td>
        </tr>

        <!--<tr>-->
            <!--<td colspan="6"><strong>注册信息</strong></td>-->
        <!--</tr>-->
        <!--<tr>-->
            <!--<td class="layui-td-gray-2">注册单位</td>-->
            <!--<td>-->
                <!--<input type="text" id="reg_unit" name="reg_unit" value="{$detail.reg_unit}" autocomplete="off"-->
                       <!--lay-reqText="注册单位" placeholder="注册单位" class="layui-input">-->
            <!--</td>-->
        <!--</tr>-->
        <!--<tr>-->
            <!--<td class="layui-td-gray-2">注册时间</td>-->
            <!--<td>-->
                <!--<input type="text" id="reg_date" name="reg_date" value="{$detail.reg_date}" autocomplete="off"-->
                       <!--lay-reqText="注册时间" placeholder="注册时间" class="layui-input">-->
            <!--</td>-->
        <!--</tr>-->
        <tr>
            <td colspan="6">
                <textarea name="remark" placeholder="请输入备注信息" class="layui-textarea">{$detail.remark}</textarea>
            </td>
        </tr>
    </table>
    {/if}

    <div class="py-3">
        <input name="id" id="id" type="hidden" value="{$id}">
        <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
</form>
{/block}
<!-- /主体 -->

<!-- 脚本 -->
{block name="script"}
<script>
    const moduleInit = ['tool', 'employeepicker', 'oaTool'];

    function gouguInit() {
        var form = layui.form, tool = layui.tool, table = layui.table, laydate = layui.laydate, oaTool = layui.oaTool,
            employeepicker = layui.employeepicker;

        laydate.render({
            elem: '#reg_date',
            showBottom: false
        });
        laydate.render({
            elem: '#cert_valid_date',
            showBottom: false
        });
        laydate.render({
            elem: '#abc_valid_date',
            showBottom: false
        });

        //相关附件上传
        oaTool.addFile();
        //radio选择
        form.on('radio(tax)', function (data) {
            if (data.value == 0) {
                $('[name="tax"]').val('0').hide();
            } else {
                $('[name="tax"]').val('').show();
            }
        });

        //监听提交
        form.on('submit(webform)', function (data) {

            let callback = function (e) {
                layer.msg(e.msg);
                if (e.code == 0) {
                    tool.sideClose(1000);
                }
            }
            tool.post("/bitjob/index/add", data.field, callback);
            return false;
        });

        form.on('select(flowtype)', function (data) {
            var check_type = data.elem[data.elem.selectedIndex].title;
            var formHtml = '<td class="layui-td-gray">收证人<font>*</font></td>\
		<td colspan="5">\
			<input type="text" name="put_user_name" value="" autocomplete="off" placeholder="请选择收证人" lay-verify="required" lay-reqText="请选择收证人" class="layui-input picker-one"><input type="hidden" name="put_user_id" value="">\
		</td>';
            if (check_type == 2) {
                $('#flow_tr').html(formHtml);
                form.render();
            }
            if (data.value == '') {
                $('#flow_tr').html(formHtml);
                $('[name="copy_names"]').val('');
                $('[name="copy_uids"]').val('');
                form.render();
                return false;
            }
            $.ajax({
                url: "/api/index/get_flow_users",
                type: 'get',
                data: {id: data.value},
                success: function (e) {
                    if (e.code == 0) {
                        var flowLi = '';
                        var flow_data = e.data.flow_data;
                        if (e.data.copy_uids && e.data.copy_uids != '') {
                            $('[name="copy_names"]').val(e.data.copy_unames);
                            $('[name="copy_uids"]').val(e.data.copy_uids.split(','));
                        }
                        if (check_type == 1 || check_type == 3) {
                            for (var a = 0; a < flow_data.length; a++) {
                                var userList = '', sign_type = '';
                                if (check_type == 1) {
                                    if (flow_data[a].flow_type == 1) {
                                        userList += '<li style="padding:3px 0">当前部门负责人</li>';
                                    }
                                    else if (flow_data[a].flow_type == 2) {
                                        userList += '<li style="padding:3px 0">上级部门负责人</li>';
                                    }
                                    else {
                                        if (flow_data[a].flow_type == 3) {
                                            sign_type = ' <span class="layui-badge layui-bg-blue">或签</span>';
                                        }
                                        if (flow_data[a].flow_type == 4) {
                                            sign_type = ' <span class="layui-badge layui-bg-blue">会签</span>';
                                        }
                                        for (var b = 0; b < flow_data[a].user_id_info.length; b++) {
                                            userList += '<li style="padding:3px 0"><img src="' + flow_data[a].user_id_info[b].thumb + '" style="width:24px; height:24px; border-radius:50%; margin-right:8px;" />' + flow_data[a].user_id_info[b].name + '</li>';
                                        }
                                    }
                                }
                                else if (check_type == 3) {
                                    sign_type = ' <span class="layui-badge layui-bg-blue">' + flow_data[a].flow_name + '</span>'
                                    for (var b = 0; b < flow_data[a].user_id_info.length; b++) {
                                        userList += '<li style="padding:3px 0"><img src="' + flow_data[a].user_id_info[b].thumb + '" style="width:24px; height:24px; border-radius:50%; margin-right:8px;" />' + flow_data[a].user_id_info[b].name + '</li>';
                                    }
                                }
                                flowLi += '<li class="layui-timeline-item">\
								<i class="layui-icon layui-timeline-axis">&#xe63f;</i>\
								<div class="layui-timeline-content">\
								  <p class="layui-timeline-title"><strong>第' + (a + 1) + '级审批</strong>' + sign_type + '</p>\
								  <ul>' + userList + '</ul>\
								</div>\
							</li>';
                            }
                            formHtml = '<td class="layui-td-gray">审批流程</td>\
									<td colspan="7">\
										<ul id="flowList" class="layui-timeline">' + flowLi + '</ul>\
									</td>';
                            $('#flow_tr').html(formHtml);
                        }
                    }
                }
            })
        });
    }
</script>
{/block}
<!-- /脚本 -->